﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ISSMoviePlex.DAL.Models;

namespace ISSMoviePlex.DAL.Repositories
{
    public class CommentRepository : BaseRepository<int,Comment, CommentRepository>
    {
       
        public IEnumerable<Comment> FindCommentsByMovieId(int movieid)
        {
            return Context.Comments.Where(c => c.MovieId == movieid);
        }
        public IEnumerable<Comment> FindCommentsByMemberId(int memberid)
        {
            return Context.Comments.Where(c => c.MemberId == memberid);
        }
        public override Comment FindById(int id)
        {
            return Context.Comments.SingleOrDefault(c => c.CommentId == id);
        }
    }
}
